#ifndef _LED_H_
#define _LED_H_

#include <string.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <driver/rmt_rx.h>
#include <driver/rmt_tx.h>
#include <soc/rmt_reg.h>
#include "driver/gpio.h" 
#include <esp_log.h>
#include <freertos/queue.h>
#include <freertos/event_groups.h>
//#include "esp32/rom/ets_sys.h"
#include "driver/ledc.h"

//定义LED的GPIO口
#define LED_GPIO  2


#define LEDC_TIMER              LEDC_TIMER_0            //定时器0
#define LEDC_MODE               LEDC_LOW_SPEED_MODE     //低速模式
#define LEDC_OUTPUT_IO          (LED_GPIO)              //选择GPIO端口
#define LEDC_CHANNEL            LEDC_CHANNEL_0          //PWM通道
#define LEDC_DUTY_RES           LEDC_TIMER_13_BIT       //分辨率
#define LEDC_DUTY               (8191)                  //最大占空比值，这里是2^13-1
#define LEDC_FREQUENCY          (5000)                  //PWM周期


//关灯完成事件标志
#define LEDC_OFF_EV  (1<<0)

//开灯完成事件标志
#define LEDC_ON_EV   (1<<1)


void led_flash_init();     //简单led闪烁

void led_breath_init();      //呼吸灯
#endif
